/*
 * @Author: 刘晟勇
 * @Date: 2021-10-17 15:37:35
 * @LastEditTime: 2021-10-23 13:49:09
 * @Description: 登录请求
 */
import axios from "./require";
import qs from 'qs'

export async function loginApi(params, callback) {
  const { data } = await axios.post('user/login', qs.stringify(params))
  callback(data)
}

export async function registerApi(params, callback) {
  const data = await axios.post('user/register', qs.stringify(params))
  callback(data)
}

export async function loginOutApi(callback) {
  const data = await axios.post('user/logout')
  callback(data)
}

export async function getQQInfo(params, callback) {
  const data = await axios.get('user/qqinfo', {
    params
  })
  callback(data)
}

export async function loginQQ(params, callback) {
  const { data } = await axios.post('user/qqlogin', qs.stringify(params))
  callback(data)
}